package com.architecture.core.utils;

import org.apache.commons.configuration.*;
import org.apache.log4j.Logger;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 12-5-16
 * Time: 上午10:34
 * To change this template use File | Settings | File Templates.
 */
public class ErrConfig {

    private static final String ERR_CONFIG_PATH = "err.properties";

    private static final String SYS_INIT_EXCEPT = "系统配置环境初始化异常。";

    private final static Logger logger = Logger.getLogger(ErrConfig.class);
    private static Configuration errConfig;

    static {
        try {
            errConfig = new PropertiesConfiguration(ERR_CONFIG_PATH);
        } catch (ConfigurationException e) {
            logger.warn(SYS_INIT_EXCEPT);
        }
    }

    public static String getCode(String errCode) {
        return errConfig.getString(errCode);
    }

}
